//package com.example.yibaodianzipinzheng.service;
//
//import com.sun.jna.platform.win32.Kernel32;
//
//public class Memory {
//
////            #region DllImports
////        [DllImport("kernel32.dll")]
////    public static extern IntPtr OpenProcess(
////            UInt32 dwDesiredAccess,
////            bool bInheritHandle,
////            Int32 dwProcessId
////    );
//
//    public static void main(String[] args) {
//        Kernel32.INSTANCE.OpenProcess();
//    }
//
//    public boolean OpenProcess(String proc)
//    {
//        return OpenProcess(GetProcIdFromName(proc));
//    }
//
//    public int GetProcIdFromName(String name)
//    {
//        Process[] processlist = Process.GetProcesses();
//
//        if (name.ToLower().Contains(".exe"))
//            name = name.Replace(".exe", "");
//        if (name.ToLower().Contains(".bin")) // test
//            name = name.Replace(".bin", "");
//
//        foreach (Process theprocess in processlist)
//        {
//            if (theprocess.ProcessName.Equals(name, StringComparison.CurrentCultureIgnoreCase)) //find (name).exe in the process list (use task manager to find the name)
//                return theprocess.Id;
//        }
//
//        return 0; //if we fail to find it
//    }
//
//}
